package com.sky.controller.user;

import com.sky.result.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.*;

/**
 * @Description TODO
 * @Author dingchunlin
 * @Date 2023/8/10 23:06
 * @Version 1.0.0
 */
@RestController("userShopController")
@RequestMapping("/user/shop")
@Api("用户店铺相关")
@Slf4j
public class ShopController {


    @Autowired
    private RedisTemplate redisTemplate;

    /**
     * 获取店铺营业状态
     * @return
     */
    @ApiOperation("获取店铺营业状态")
    @GetMapping("/status")
    public Result<Integer> getStatus(){
        Integer shop_status = (Integer)redisTemplate.opsForValue().get("SHOP_STATUS");
        return Result.success(shop_status);
    }

}
